package com.company.cloud.base.modules.api.fallback;

import com.company.cloud.base.modules.api.models.BizCodeModel;
import com.company.cloud.base.modules.api.service.BaseClientService;
import com.company.cloud.common.bean.BaseClientResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

@Log4j2
@Component
public class BaseClientServiceFallbackFactory implements FallbackFactory<BaseClientService>{

	@Override
	public BaseClientService create(Throwable cause) {
		return new BaseClientService() {

			@Override
			public BaseClientResult<BizCodeModel> getBizCode(BizCodeModel param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> updateBizCode(BizCodeModel param) {

				return  BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> getParaVal(String paraKey) {
				return  BaseClientResult.callbackError();
			}
		};
	}


}
